/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-10 09:04:34
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-10 09:23:56
 */
//Teacher类
//成员变量
//  姓名
//  性别
//  工号
//  利用封装的特点提供对应的set get 方法，提供三个构造器(无参 两参 三参) 创建三个对象 调用这些对象最后用一个sayHello的方法输出全部
public class Teacher{
    //成员变量
    private String name;
    private char gender;
    private String workId;
    //无参构造器
    public Teacher(){
        System.out.println("调用了Teacher无参构造器");
    }
    //两参构造器
    public Teacher(String name,char gender){
        this.name = name;
        this.gender = gender;
        System.out.println("调用了Teacher两参构造器");
    }
    //三参构造器
    public Teacher(String name,char gender,String workId){
        this(name,gender);
        this.workId = workId;
        System.out.println("调用了Teacher三参构造器");
    }
    //set
    public void setName(String name){
        this.name = name;
    }
    public void setGender(char gender){
        this.gender = gender;
    }
    public void setWorkId(String workId){
        this.workId = workId;
    }
    //get
    public String getName(){
        return name;
    }
    public char getGender(){
        return gender;
    }
    public String getWorkId(){
        return workId;
    }
    //sayHello输出
    public void sayHello(){
        System.out.println("我是"+name+"，我的性别是"+gender+"，我的工号是"+workId);
    }
    
}
